package net.jxta.myjxta.plugin;

import java.util.logging.Logger;

public abstract class PluginBase implements Plugin {

    protected static final Logger LOG = Logger.getLogger(PluginBase.class.getName());
    protected PluginContainer m_container;
    protected String m_name;
    protected boolean m_running = false;

    protected PluginBase() {
        LOG.log(java.util.logging.Level.FINE, "Instantiating..");
    }

    protected void setName(String p_name) {
        m_name = p_name;
    }

    public void init(PluginContainer c) {
        LOG.log(java.util.logging.Level.FINE, "Initiating...");
        m_container = c;
    }

    public void destroy() {
        LOG.log(java.util.logging.Level.FINE, "Plugin was destroyed");
    }

    public boolean isRunning() {
        return m_running;
    }

    public void start() {
        LOG.log(java.util.logging.Level.FINE, "Plugin started");
        m_running = true;
    }

    public void stop() {
        LOG.log(java.util.logging.Level.FINE, "Plugin stopped");
        m_running = false;
    }

    public IPluginNotificationHandler getPluginNotificationHander() {
        return null;
    }

    public String getName() {
        return m_name;
    }
}
